home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / bsrc_p2.arc / OPUS_ASM.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-11-30  |  12.3 KB  |  416 lines

  1. .xlist
  2.         page    64,132
  3.         title   Mid-level FOSSIL Communications routines
  4.         subttl  by Wynn Wagner III
  5.         name    Com_Asm
  6.         .sall
  7. .list
  8. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  9. ;
  10. ;
  11. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  12. ;;                       ;;
  13. ;; OPUS FOSSIL INTERFACE ;;
  14. ;;                       ;;  
  15. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  16. ;
  17. ;
  18. ; OPUS_ASM:  Node list compiler for Opus-Cbcs, v0.00
  19. ;
  20. ; ASSEMBLER: MicroSoft MASM, v4.00
  21. ;
  22. ; MACROS:    MicroSoft cMacros, v1.06 (included with MicroSoft C compiler)
  23. ;
  24. ;
  25. ;
  26. ;
  27. ; FOSSIL:    OPUS-Cbcs uses a standard interface to modems (data layer)
  28. ;            contained in a resident program which follows the FOSSIL
  29. ;            protocol.  This file contains routines used by OPUS-Cbcs
  30. ;            to communicate with the FOSSIL program.  For more information
  31. ;            about the specifications for a FOSSIL sub-system, contact
  32. ;            Vince Perriello (FidoNet 141/491).
  33. ;
  34. ;
  35. ;
  36. ;
  37. ; General notices/warnings/threats:
  38. ;
  39. ;    This source code is NOT public domain.  It has a copyright.  
  40. ;
  41. ;
  42. ; Specific notices/warnings/threats on USING this source code:
  43. ;
  44. ;    You are hereby given a limited license (permission) to use this source 
  45. ;    code in any manner you see fit as long as you do so in a lawful and
  46. ;    friendly manner and do not get any consideration other than goodwill 
  47. ;    from your efforts.  In other words, this material is not available for 
  48. ;    use in any product that is sold (including so-called ShareWare).  If 
  49. ;    you use this source code in any manner, then your end result must be 
  50. ;    freely available.
  51. ;
  52. ;
  53. ; Specific notices/warnings/threats on DISTRIBUTING this source code:
  54. ;
  55. ;    This source code may not be distributed if it is modified.
  56. ;
  57. ;    Also, you may not make money from the transfer of this source code.
  58. ;    In other words, you may not charge others for access to the material.
  59. ;    This includes transfer by diskette.  It also means that BBS's and other
  60. ;    systems which charge a fee are not allowed to keep this material 
  61. ;    on-line for download.
  62. ;
  63. ;    OPUS software is always free.  Period.  No exceptions.
  64. ;
  65. ;    If you purchased this source code, please contact OPUSinfo,
  66. ;    FidoNet<tm> 1/113, 1-214-991-3381.
  67. ;
  68. ;
  69. ; Notice about warranty:
  70. ;
  71. ;    Nothing in this file is warranted or guaranteed to do anything except
  72. ;    take up disk space.  If you cannot live without some warranty and/or
  73. ;    guarantee, them please don't use this material.
  74. ;
  75. ;
  76. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  77. ;
  78.         if1
  79.         %out    FOSSIL routines for OPUS-Cbcs
  80.         %out    Copyright 1987. Wynn Wagner III. All Rights Reserved
  81.         endif
  82.         include version.inc
  83.         include msdos.inc
  84.         include cmacros.inc
  85.         if2
  86.         if memS ne 1
  87.         if memM ne 1
  88.         error   <You have to use SMALL data memory for this module.>
  89.         endif
  90.         endif
  91.         endif
  92. ;
  93. ;
  94. ;
  95. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  96. ;
  97. ; LOG:
  98. ;        WW3...18-Feb-87......Added ctrl-break logic to `ComI()'
  99. ;
  100. ;
  101. ;
  102. ;
  103. ;
  104. ;
  105. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  106. ;
  107. ;
  108. ;
  109. ;
  110. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  111. ;;                       ;;  
  112. ;;     DEFINITIONS       ;;
  113. ;;                       ;;
  114. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  115. ;
  116. ;
  117. MODEM    equ      14H      ; interrupt taken over by FOSSIL programs
  118. FROMOPUS equ    4f50H      ; see `ComI()' for usage
  119. ;
  120. ;
  121. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  122. ;
  123. ;
  124. ;
  125. ;
  126. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  127. ;;                       ;;  
  128. ;;       EXTERNAL        ;;
  129. ;;     DECLARATIONS      ;;
  130. ;;                       ;;
  131. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  132. ;
  133. ;
  134. ; EXTRN   _kbdbreak:word     commented out by vince
  135. ;
  136. ;
  137. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  138. ;
  139. ;
  140. ;
  141. ;
  142. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  143. ;;                       ;;  
  144. ;;     DATA SEGMENT      ;;
  145. ;;                       ;;
  146. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  147. ;
  148. ;
  149. sBegin   data
  150.  
  151. staticW  Port,0
  152.  
  153. sEnd
  154. ;
  155. ;
  156. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  157. ;
  158. ;
  159. ;
  160. ;
  161. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  162. ;;                       ;;  
  163. ;;     CODE SEGMENT      ;;
  164. ;;                       ;;
  165. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  166. ;
  167. ;
  168. sBegin   code
  169.  
  170.          assumes  cs,code
  171.          assumes  ds,data
  172.                                 
  173. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  174.  
  175.          page
  176.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  177.          ;;                                          ;;
  178.          ;; ROUTINE: _Com_                           ;;
  179.          ;;                                          ;;
  180.          ;; PURPOSE: General calls to FOSSIL         ;;
  181.          ;;                                          ;;
  182.          ;; USAGE:   int Com_(request,parm1);        ;;
  183.          ;;          byte request, parm1;            ;;
  184.          ;;                                          ;;
  185.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  186.  
  187. cProc    Com_,<PUBLIC>,<si,di>
  188.  
  189.          parmB    request
  190.          parmB    parm1
  191.  
  192. cBegin
  193.  
  194.          mov      ah, request
  195.          mov      al, parm1
  196.          mov      dx, Port
  197.          int      MODEM
  198.  
  199.          cld
  200.                 
  201. cEnd
  202.  
  203. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  204.  
  205.          page
  206.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  207.          ;;                                          ;;
  208.          ;; ROUTINE: _ComI                           ;;
  209.          ;;                                          ;;
  210.          ;; PURPOSE: Initialize the FOSSIL system    ;;
  211.          ;;                                          ;;
  212.          ;; USAGE:   int ComI(WhichPort);         ;;
  213.          ;;          byte WhichPort                  ;;
  214.          ;;                                          ;;
  215.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  216.  
  217. cProc    ComI,<PUBLIC>,<si,di>
  218.  
  219.          parmB    WhichPort
  220.  
  221. cBegin
  222.  
  223.          mov      ah,  4            ; initialization service request
  224.          xor      dh,  dh
  225.          mov      dl,  WhichPort
  226.          mov      Port,dx
  227.                                     ;-----------------------------------------
  228.                                     ; ADDED: WW3 18-Feb-87
  229.                                     ;
  230.                                     ; On an initialization call, iff bx
  231.                                     ; contains 0x4f50 and the FOSSIL program
  232.                                     ; supports it, then when a control-break
  233.                                     ; is detected from the keyboard, FOSSIL
  234.                                     ; will set the value at DS:DX to 
  235.                                     ; non-zero.
  236.                                     ;
  237.                                     ; This is an OPUS-only extension to
  238.                                     ; FOSSIL primarily intended for non-IBM
  239.                                     ; computers such as the DEC Rainbow.
  240.                                     ;
  241.                                     ; The example here assumes SMALL memory
  242.                                     ; model.  For other models, you should
  243.                                     ; add code to set DS to the correct
  244.                                     ; segment.
  245.                                     ;
  246. ;        mov      bx,  FROMOPUS     ; <--- Let FOSSIL know it's OPUS calling
  247. ;        lea      cx,  _kbdbreak    ; <--- Offset of control-break variable
  248.                                     ;
  249.                                     ; END ADDITION
  250.                                     ;-----------------------------------------
  251.          int      MODEM
  252.  
  253.          push     ax
  254.  
  255.          mov      ax, 0f01H         ; Use XON/XOFF
  256.          mov      dx, Port
  257.          int      MODEM
  258.  
  259. ;        mov      ax, 1001H         ; Enable ^C/^K checking from remote
  260. ;        mov      dx, Port
  261. ;        int      MODEM
  262.  
  263.          cld
  264.          pop      ax
  265.  
  266. cEnd
  267.  
  268. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  269.  
  270. cProc    fossil_block,<PUBLIC>
  271.         parmW   cnum
  272.         parmD   pntr
  273.         parmW   len
  274.  
  275. cBegin
  276.  
  277.         PUSH    SI
  278.         PUSH    DI
  279.         PUSH    ES
  280.         PUSH    DS
  281.  
  282.         MOV     CX,len          ; Length of buffer to read
  283.         MOV     DX,Port         ; Put in the port number
  284.         LES     DI,pntr         ; Get ES:DI set up
  285.         LDS     SI,pntr         ; Just in case it is rev 4
  286.         MOV     AX,cnum         ; Call number
  287.         INT     14H             ; Call the FOSSIL
  288.  
  289.         POP     DS
  290.         POP     ES
  291.         POP     DI
  292.         POP     SI
  293. cEnd
  294.  
  295. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  296.  
  297.  
  298.          page
  299.  
  300.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  301.          ;;                                          ;;
  302.          ;; ROUTINE: _fossil_gotoxy                  ;;
  303.          ;;                                          ;;
  304.          ;; PURPOSE: Send the local cursor to a      ;;
  305.          ;;          screen location.  Column and    ;;
  306.          ;;          row are both 0-based values.    ;;
  307.          ;;                                          ;;
  308.          ;; USAGE:   void fossil_gotoxy(column,row); ;;
  309.          ;;          unsigned char column, row;      ;;
  310.          ;;                                          ;;
  311.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  312.  
  313. cProc    fossil_gotoxy,<PUBLIC>
  314.  
  315.          parmB    column
  316.          parmB    row
  317.  
  318. cBegin
  319.  
  320.          mov      ah, 11h
  321.          mov      dh, row
  322.          mov      dl, column
  323.          int      MODEM
  324.  
  325.          cld
  326.                 
  327. cEnd
  328.  
  329.  
  330. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  331.  
  332.          page
  333.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  334.          ;;                                          ;;
  335.          ;; ROUTINE: _fossil_whereami                ;;
  336.          ;;                                          ;;
  337.          ;; PURPOSE: Return the current screen       ;;
  338.          ;;          location as two nybbles.        ;;
  339.          ;;                                          ;;
  340.          ;; USAGE:   int fossil_whereami(void);      ;;
  341.          ;;                                          ;;
  342.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  343.  
  344. cProc    fossil_whereami,<PUBLIC>
  345.  
  346. cBegin
  347.  
  348.          mov      ah, 12h
  349.          int      MODEM
  350.          mov      ax, dx
  351.  
  352.          cld
  353.                 
  354. cEnd
  355.  
  356. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  357.  
  358.          page
  359.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  360.          ;;                                          ;;
  361.          ;; ROUTINE: _fossil_wherey                  ;;
  362.          ;;                                          ;;
  363.          ;; PURPOSE: Return the current column on    ;;
  364.          ;;          the local monitor.              ;;
  365.          ;;                                          ;;
  366.          ;; USAGE:   int wherey(void);               ;;
  367.          ;;                                          ;;
  368.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  369.  
  370. cProc    fossil_wherey,<PUBLIC>
  371.  
  372. cBegin
  373.  
  374.          mov      ah, 12h
  375.          int      MODEM
  376.          mov      al, dh
  377.          xor      ah, ah
  378.  
  379.          cld
  380.                 
  381. cEnd
  382.  
  383.  
  384. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  385.  
  386.          page
  387.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  388.          ;;                                          ;;
  389.          ;; ROUTINE: _fossil_wherex                  ;;
  390.          ;;                                          ;;
  391.          ;; PURPOSE: Return the current row on the   ;;
  392.          ;;          local monitor.                  ;;
  393.          ;;                                          ;;
  394.          ;; USAGE:   int wherex(void);               ;;
  395.          ;;                                          ;;
  396.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  397.  
  398. cProc    fossil_wherex,<PUBLIC>
  399.  
  400. cBegin
  401.  
  402.          mov      ah, 12h
  403.          int      MODEM
  404.          mov      al, dl
  405.          xor      ah, ah
  406.  
  407.          cld
  408.                 
  409. cEnd
  410.  
  411. sEnd
  412.         end
  413.  
  414. ;; END OF FILE: Com_Asm.Asm ;;
  415.  
  416.